package com.project.nimsen.dto;

import java.util.ArrayList;
import java.util.List;

import org.apache.shiro.util.CollectionUtils;

import com.project.nimsen.entity.Wxsendmsg;
import com.project.jdbc.utils.Page;

public class WxsendmsgDto {
	private String rtype;//回复信息类型
	private Page page;//分页信息
	private String id;//id的信息
	private String siteid;//站点编号
	private String pid;//父级编号信息
	private Wxsendmsg newsr;//图文回复的父级信息
	private List<Wxsendmsg> news_childs;//图文回复的子信息
	public Wxsendmsg getNewsr() {
		return newsr;
	}

	public void setNewsr(Wxsendmsg newsr) {
		this.newsr = newsr;
	}
	public void addChild(Wxsendmsg msg) throws Exception{
		if(newsr == null){
			throw new Exception("newsr不可以为空。");
		}
		if(CollectionUtils.isEmpty(news_childs))
			news_childs = new ArrayList<Wxsendmsg>();
		news_childs.add(msg);
	}
	public List<Wxsendmsg> getNews_childs() {
		if(newsr==null)
			return null;
		return news_childs;
	}

	//要验证的字段
	private String valifield;
	//验证的字段值
	private String valivalue;

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getSiteid() {
		return siteid;
	}

	public void setSiteid(String siteid) {
		this.siteid = siteid;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getValifield() {
		return valifield;
	}

	public void setValifield(String valifield) {
		this.valifield = valifield;
	}

	public String getValivalue() {
		return valivalue;
	}

	public void setValivalue(String valivalue) {
		this.valivalue = valivalue;
	}

	public Page getPage() {
		return page;
	}

	public void setPage(Page page) {
		this.page = page;
	}

	public String getRtype() {
		return rtype;
	}

	public void setRtype(String rtype) {
		this.rtype = rtype;
	}
}
